# determine how to comment/uncomment the mpi interface header file
if(USE_MPI)
  set(MPI_COMMENT_I "")
  set(MPI_COMMENT_O "//")
else(USE_MPI)
  set(MPI_COMMENT_I "//")
  set(MPI_COMMENT_O "")
endif(USE_MPI)

# create header file for mpi functions
configure_file(interface.h.in ${FORMIC_BINARY_DIR}/src/formic/mpi/interface.h)

# create cpp file for mpi functions
configure_file(interface.cpp.in ${FORMIC_BINARY_DIR}/src/formic/mpi/interface.cpp)

# create the library
add_library(formic_mpi ${FORMIC_BINARY_DIR}/src/formic/mpi/interface.cpp)

target_link_libraries(formic_mpi formic_vector)

# how to install the library
install(
        TARGETS
          formic_mpi
        RUNTIME DESTINATION
          bin
        LIBRARY DESTINATION
          lib
        ARCHIVE DESTINATION
          lib
       )
